package com.dwfyc.hibernate;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 * Rolsubtarea entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "rolsubtarea", catalog = "firmes")
public class Rolsubtarea implements java.io.Serializable {

	// Fields

	private Integer idrolSubtarea;
	private Rol rol;
	private Subtarea subtarea;

	// Constructors

	/** default constructor */
	public Rolsubtarea() {
	}

	/** full constructor */
	public Rolsubtarea(Integer idrolSubtarea, Rol rol, Subtarea subtarea) {
		this.idrolSubtarea = idrolSubtarea;
		this.rol = rol;
		this.subtarea = subtarea;
	}

	// Property accessors
	@Id
	@Column(name = "idrolSubtarea", unique = true, nullable = false)
	public Integer getIdrolSubtarea() {
		return this.idrolSubtarea;
	}

	public void setIdrolSubtarea(Integer idrolSubtarea) {
		this.idrolSubtarea = idrolSubtarea;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "idRol", nullable = false)
	public Rol getRol() {
		return this.rol;
	}

	public void setRol(Rol rol) {
		this.rol = rol;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "idSubtarea", nullable = false)
	public Subtarea getSubtarea() {
		return this.subtarea;
	}

	public void setSubtarea(Subtarea subtarea) {
		this.subtarea = subtarea;
	}

}